<template>

	<view class="submit_order">
		<!-- 适配状态栏 -->
		<view class="status_bar"></view>

		<view class="top_title flex-btw">
			<view>
				<text class="custom-icon custom-icon-jiantou2" @click="leftClick"></text>
				<text class="name">配送范围</text>
			</view>

		</view>

		<view class="">

			<!-- <baidu-map class="bm-view" :ak="ak" :center="center" :zoom="zoom" :scroll-wheel-zoom="true">
				<bm-navigation anchor="BMAP_ANCHOR_TOP_BOTTOM"></bm-navigation>
				<bm-polygon :path="polygonPath" stroke-color="red" fill-color="#FB6160" :fill-opacity="0.2"
					:stroke-opacity="2" :stroke-weight="3" :editing="false" />
			</baidu-map> -->

		</view>
	</view>
</template>

<script>
	import {
		$https
	} from '@/static/js/request.js';

	// #ifdef H5
	// import {
	// 	BaiduMap,
	// 	bmInfoWindow,
	// 	BmMarker,
	// 	BmPolygon,
	// 	BmGeolocation,
	// 	BmNavigation
	// } from "vue-baidu-map";

	// #endif


	export default {
		// #ifdef H5
		// components: {
		// 	BaiduMap,
		// 	bmInfoWindow,
		// 	BmMarker,
		// 	BmPolygon,
		// 	BmGeolocation,
		// 	BmNavigation
		// },
		// #endif

		data() {
			return {
				center: {
					lng: '',
					lat: ''
				},
				zoom: 15,
				polygonPath: [],
				ak: 'GPO8jLk2SoDXF5nnaOdDudHxIsMVEK6V'
			}

		},
		onLoad() {
			this.getData()
		},
		methods: {
			leftClick() {
				// #ifdef H5
				window.history.back(-1);
				// #endif 
				// #ifndef H5
				uni.navigateBack();
				// #endif
			},
			getData() {
				$https('GET', 'getUserInfo', {}, res => {
					if (res.data.errcode == 0) {
						this.polygonPath = res.data.data.quadrants
						this.center.lng = res.data.data.quadrants[0].lng
						this.center.lat = res.data.data.quadrants[0].lat
					} else {
						uni.showToast({
							title: res.data.errmsg,
							icon: 'none'
						})
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.submit_order {
		.status_bar {
			position: fixed;
			top: 0;
		}

		.top_title {
			position: fixed;
			width: 100%;
			// #ifndef MP-WEIXIN
			top: calc(var(--status-bar-height));
			// #endif
			// #ifdef MP-WEIXIN
			top: 0;
			// #endif
			background: rgb(246, 246, 246);
			align-items: center;
			height: 88rpx;
			padding: 0 30rpx;
			z-index: 100;

			.custom-icon {
				font-size: 36rpx;
				color: #191919;
				margin-right: 36rpx;
				font-weight: 600;
			}

			.name {
				color: #191919;
				font-size: 36rpx;
				font-weight: 600;
			}

		}

	}

	.bm-view {
		width: 100%;
		height: 100vh;
	}

	#container {
		width: 100%;
		height: 100vh;
	}
</style>
